import { getAllRankList, rankSongDetail} from 'api/index'
import { getRankSongList } from "api/rank";

export default class Rank {
  constructor({id, introduction, title, pic}) {
    this.id = id
    this.introduction = introduction
    this.title = title
    this.pic = pic
    this.list = getRankSongList(this.id)
  }
}

export function createRank(rank) {
  return new Rank({
    id: rank.id,
    introduction: rank.introduction,
    title: rank.title,
    pic: `http://127.0.0.1:8888${rank.pic}`,
    list: getRankSongList(rank.id)
  })
}
